﻿using System.Web.UI;
using System.Web.UI.Adapters;

namespace Folks.UI.Adapters
{
	public class FolksPageAdapter : PageAdapter
	{
		public override PageStatePersister GetStatePersister()
		{
			FolksManager manager = FolksManager.GetCurrent(Page);

			return (manager != null && manager.OptimizeViewState) 
				? new FolksPageStatePersister(Page) 
				: base.GetStatePersister();
		}
	}
}
